﻿
@{
    ViewBag.Title = "Salary";
    Layout = "~/Views/Shared/Index.cshtml";
}


@model List<YaYun.Models.Salary>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>table 组件综合演示 - Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="/cdn.staticfile.org/layui/2.8.0/css/layui.css" rel="stylesheet">
</head>
<body>

    @using (Html.BeginForm("Salary", "Home", FormMethod.Post, new { id = "" }))
    {
       
     

        <div class="layui-form-item">
            <div class="layui-input-group">
                <div class="layui-input-split layui-input-prefix">
                    <input type="text" class="layui-input" name="name" placeholder="请输入要查询的姓名" value="@ViewBag.SearchName">
                </div>             
                <input type="submit" class="layui-btn" value="查询记录" />
            </div>
        </div>
    }

    <table class="layui-table layui-form">
        <tr>
            <th class="emp_id_td">编号</th>
            <th class="emp_tr_t">姓名</th>
            <th class="emp_tr_t">金额</th>
            <th class="emp_tr_t">发放时间</th>
            <th class="emp_tr_t">银行卡号</th>
            <th class="emp_tr_t">发放方式</th>

        </tr>
        @{
            int numid = 1;
        }
        @foreach (var item in Model)
        {
            <tr class="tr_hover">
                <td class="emp_id_td">@item.Employee.id</td>
                <td class="emp_tr_t">@item.Employee.EmployeeName</td>
                <td class="emp_tr_t">@string.Format("{0:C}", item.amount)</td>
                @{
                    var date = item.Paytime;
                    var strdate = "";
                    if (date != null)
                    {
                        strdate = DateTime.Parse(date.ToString()).ToString("yyyy年MM月dd日hh时ss分");
                    }
                }
                <td class="emp_tr_t">@strdate</td>
                <td class="emp_tr_t">@item.bank</td>
                <td class="emp_tr_t">@item.Salary_play_method</td>
                &nbsp;
            </tr>
            numid++;

        }
        <tr></tr>
        <tr class="page_item">
        </tr>
    </table>
    <div class="demo-laypage-pn-show">
        @Html.ActionLink("上一页", "Salary", new { page = ViewBag.CurrentPage - 1 }, new { @class = "layui-btn" })
        @for (int i = 1; i <= ViewBag.TotalPages; i++)
        {
            if (i == ViewBag.CurrentPage)
            {
                @Html.Label($"{@i}", new { @class = "layui-btn layui-btn-sm layui-btn-warm" }) ;
            }
            else
            {
                @Html.ActionLink(i.ToString(), "Salary", new { page = i }, new { @class = "layui-btn layui-btn-primary layui-btn-sm" });
            }
        }
        @Html.ActionLink("下一页", "Salary", new { page = ViewBag.CurrentPage + 1 }, new { @class = "layui-btn" })
    </div>
</body>
</html>

